package com.cencat.merchant.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.*;

/**
 * 商家用户更新DTO
 * @author cencat
 * @since 2024-01-01
 */
@Data
@Schema(description = "商家用户更新DTO")
public class MerchantUserUpdateDTO {

    @Schema(description = "用户ID", required = true, example = "1")
    @NotNull(message = "用户ID不能为空")
    @Min(value = 1, message = "用户ID必须大于0")
    private Long id;

    @Schema(description = "真实姓名", example = "张三")
    @Size(min = 2, max = 50, message = "真实姓名长度必须在2-50之间")
    private String realName;

    @Schema(description = "邮箱", example = "zhangsan@example.com")
    @Email(message = "邮箱格式不正确")
    @Size(max = 100, message = "邮箱长度不能超过100")
    private String email;

    @Schema(description = "手机号", example = "13800138000")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Schema(description = "角色", example = "ADMIN")
    @Size(max = 50, message = "角色长度不能超过50")
    private String role;

    @Schema(description = "权限", example = "user:read,user:write")
    @Size(max = 500, message = "权限长度不能超过500")
    private String permissions;

    @Schema(description = "头像URL", example = "https://www.example.com/avatar.png")
    @Size(max = 200, message = "头像URL长度不能超过200")
    private String avatar;

    @Schema(description = "备注", example = "管理员用户")
    @Size(max = 500, message = "备注长度不能超过500")
    private String remark;
}